<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Document</title>
</head>
<body>
<!-- 新增顶部返回栏 -->
<div class="top-bar">
    <div class="back-btn" onclick="location.href='/'">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="#1E80FF">
            <path d="M19 12H5M12 19l-7-7 7-7"/>
        </svg>
        返回首页
    </div>
</div>
<main>
    <div class="article-page">


        <!-- 左侧互动栏 -->
        <div class="action-sidebar">
            <div class="action-item">
                <svg width="24" height="24" viewBox="0 0 48 48" fill="#FF4756">
                    <path d="M24 42.7L12 28h8V6h8v22h8z"/>
                </svg>
                <div class="count">82</div>
            </div>
            <div class="action-item">
                <svg width="24" height="24" viewBox="0 0 48 48" fill="#1E80FF"> <!-- 新增评论图标 -->
                    <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm-2-22h4v12h-4zm0-6h4v4h-4z"/>
                </svg>
                <div class="count">28</div>
            </div>
            <div class="action-item">
                <svg width="24" height="24" viewBox="0 0 48 48" fill="#FFB121">
                    <path d="M24 40.2l-12.6 6.6 3.2-14.4L.4 18.6l14.6-1.2L24 4l9 13.4 14.6 1.2-10.2 9.8 3.2 14.4z"/>
                </svg>
                <div class="count">133</div>
            </div>
            <!-- 点赞 -->
            <div class="action-item" style="color:#FF4756">
                <svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
                    <path d="M2 8.4C2 5 4 3 7 3h1c2 0 4 1 5 3l2 3h3c3 0 5 2 5 5v3c0 3-2 5-5 5H6c-2 0-4-1-4-4v-9z"/>
                </svg>
                <div class="count">82</div>
            </div>

            <!-- 评论 -->
            <div class="action-item" style="color:#1E80FF">
                <svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
                    <path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4V4c0-1.1-.9-2-2-2zm-3 12H7v-2h10v2zm0-3H7V9h10v2zm0-3H7V6h10v2z"/>
                </svg>
                <div class="count">28</div>
            </div>
        </div>

        <!-- 中间文章内容 -->
        <div class="article-main">
            <div class="article-header">
                <h1 class="title">什么鬼？两行代码就能适应任何屏幕？</h1>
            </div>

            <div class="article-content">
                <p class="highlight">你可能想不到，只用两行CSS，就能让你的卡片、图片、内容块自动适应各种屏幕宽度，彻底摆脱复杂的媒体查询！秘诀就是CSS Grid的<strong>auto-fill</strong>和<strong>auto-fit</strong>。</p>

                <pre class="code-block">
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}</pre>

                <div class="keywords">
                    <span># AI</span>
                    <span># CSS</span>
                    <span># 响应式设计</span>
                </div>
            </div>
        </div>

        <!-- 右侧用户信息 -->
        <div class="user-sidebar">
            <div class="user-card">
                <div class="user-header"> <!-- 新增flex容器 -->
                    <img src="image/1.jpg" class="user-avatar" style="width:60px;height:60px">
                    <div class="user-info">
                        <h3>前端九哥</h3>
                        <p class="position">前端工程师@四四零零减一</p>
                    </div>
                </div>

                <div class="stats">
                    <div>
                        <div class="number">22</div>
                        <div class="label">文章</div>
                    </div>
                    <div>
                        <div class="number">9.8k</div>
                        <div class="label">阅读</div>
                    </div>
                    <div>
                        <div class="number">23</div>
                        <div class="label">粉丝</div>
                    </div>
                </div>

                <div class="actions">
                    <button class="follow-btn">关注</button>
                    <button class="message-btn">私信</button>
                </div>
            </div>

            <div class="toc">
                <h4>目录</h4>
                <div class="toc-item">1. grid/template-columns</div>
                <div class="toc-item">2. repeat(auto-fit, ...)</div>
                <div class="toc-item">3. minmax(200px,1fr)</div>
            </div>
        </div>
    </div>
</main>

<style>

    .article-page {
        display: flex;
        max-width: 1200px;
        margin: 20px auto;
        gap: 40px;
    }

    /* 左侧互动栏 */
    .action-sidebar {
        width: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding-top: 40px;
    }
    .action-item {
        text-align: center;
        cursor: pointer;
    }
    .count {
        color: #86909C;
        font-size: 14px;
        margin-top: 8px;
    }

    /* 中间文章内容 */
    .article-main {
        flex: 1;
        max-width: 800px;
    }
    .author-info {
        display: flex;
        align-items: center;
        margin-bottom: 24px;
    }
    .author-avatar {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        margin-right: 16px;
    }
    .meta {
        color: #86909C;
        font-size: 14px;
        margin-top: 8px;
    }
    .meta span {
        margin-right: 16px;
    }
    .title {
        font-size: 32px;
        margin: 0 0 24px;
    }
    .highlight {
        font-size: 18px;
        line-height: 1.8;
        color: #1D2129;
        border-left: 4px solid #1E80FF;
        padding-left: 16px;
    }
    .code-block {
        background: #F7F8FA;
        padding: 20px;
        border-radius: 4px;
        font-family: monospace;
        margin: 24px 0;
    }
    .keywords {
        margin-top: 24px;
    }
    .keywords span {
        display: inline-block;
        background: #E8F3FF;
        color: #1E80FF;
        padding: 4px 12px;
        border-radius: 4px;
        margin-right: 12px;
    }

    /* 右侧用户信息 */
    .user-sidebar {
        width: 280px;
    }
    .user-card {
        background: white;
        padding: 24px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        text-align: center;
    }
    .user-avatar {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        margin-bottom: 16px;
    }
    .position {
        color: #86909C;
        font-size: 14px;
        margin: 8px 0;
    }
    .stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        margin: 24px 0;
    }
    .number {
        font-size: 18px;
        font-weight: 500;
    }
    .label {
        color: #86909C;
        font-size: 12px;
    }
    .actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .follow-btn {
        background: #1E80FF;
        color: white;
        border: none;
        padding: 8px;
        border-radius: 4px;
    }
    .message-btn {
        background: white;
        border: 1px solid #1E80FF;
        color: #1E80FF;
        padding: 8px;
        border-radius: 4px;
    }

    .toc {
        margin-top: 24px;
        padding: 24px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .toc h4 {
        margin: 0 0 16px;
    }
    .toc-item {
        color: #1E80FF;
        padding: 8px 0;
        cursor: pointer;
    }

    @media (max-width: 768px) {
        .article-page {
            flex-direction: column;
            padding: 0 16px;
        }
        .action-sidebar {
            width: 100%;
            flex-direction: row;
            justify-content: center;
            padding: 16px 0;
        }
        .user-sidebar {
            width: 100%;
        }
    }
    /* 新增用户信息行布局 */
    .user-header {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 24px;
    }
    .user-info {
        flex: 1;
    }
    .user-info h3 {
        margin: 0;
        font-size: 20px;
    }
    .position {
        margin: 4px 0 0;
        font-size: 14px;
    }

    /* 优化左侧导航栏 */
    .action-sidebar {
        width: 80px;
        padding: 20px 0;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-radius: 8px;
    }
    .action-item {
        padding: 12px 0;
        transition: all 0.2s;
    }
    .action-item:hover {
        background: #f5f7fa;
    }
    /* 新增顶部导航栏样式 */
    .top-bar {
        width: 100%;
        height: 60px;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        display: flex;
        align-items: center;
        padding: 0 40px;
        z-index: 100;
    }
    .back-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #1E80FF;
        cursor: pointer;
        transition: all 0.2s;
    }
    .back-btn:hover {
        opacity: 0.8;
    }
    .nav-brand {
        font-weight: bold;
        margin-left: 24px;
        font-size: 18px;
    }

</style>
</body>
</html>